<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="normalize.css">
    <style>
      body {
        --text-color: rgb(200, 200, 200);
        --text-color-alt: rgb(0, 0, 0);
        --text-color-muted: rgb(128, 128, 128);
        --text-color-strong: rgb(255, 255, 255);

        --background-color: rgb(28, 30, 35);
        --background-color-alt: rgb(35, 37, 46);

        --shade1: rgb(21, 23, 26);
        --shade2: rgb(18, 18, 24);

        --input-color: var(--shade1);
        --input-color-hover: var(--shade2);

        --accent-color-blue: #147df1; /* rgb(51, 153, 255); */;
        --accent-color-red: rgb(250, 52, 37);
        --accent-color-yellow: rgb(255, 193, 47);
        --accent-color-green: #7af2a6 ; /*rgb(104, 232, 188);*/

        width: 196px;
        margin: 0;
        padding: 0;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
          "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
          sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        font-size: 0.8125rem;

        background: var(--background-color);
        color: var(--text-color);
        fill: var(--text-color);
      }
      #content {
        margin: 0.5rem;
      }
      #header-wrapper {
        margin: 4px;
        width: 100%;
        display: flex;
      }
      #header {
        margin: auto;
        display: flex;
      }
      #header img {
        padding: 4px;
        width: 32px;
        height: 32px;
      }
      #header h2 {
        font-size: 0.8125rem;
        font-weight: bold;
        margin: auto 0;
      }
      #tag-form {
        display: flex;
      }
      #tag-form label {
        flex-grow: 1;
      }
      #preview-img-wrapper {
        max-height: 200px;
      }
      #preview-img {
        max-width: 100%;
        max-height: 200px;
        margin-left: auto;
        margin-right: auto;
        display: flex;
      }
      #form-info {
        margin: 0;
        margin-bottom: 0.5rem;
        margin-top: 0.25rem;
      }
      #tags-input {
        box-sizing: border-box;
        width: 100%;
      }
      #tag-form-submit {
        align-self: end;
        margin-top: auto;
      }
      button {
        background: transparent;
        border-radius: 0.25rem;
        height: 26.5px;
        width: 26.5px;
        margin: 1px;
        margin-left: 3px;
        outline: none;
        border: none;
      }
      button:hover {
        color: var(--text-color-strong);
        fill: var(--text-color-strong);
        background-color: var(--input-color-hover);
      }

      /* Inspired by Allusion style */
      input {
        background: var(--input-color);
        border: 0.0625rem solid var(--border-color);
        outline: none;
        border-radius: 0.25rem;
        margin: 0.125rem 0;
        cursor: text;
        line-height: 1.5rem;
        color: var(--text-color);
      }
      input:hover {
        background: var(--input-color-hover);
      }
      input:focus-within {
        background: var(--input-color);
        box-shadow: 0 0 0 0.125rem var(--accent-color-blue);
      }
      *:disabled{
        color: var(--text-color-muted);
        background-color: transparent;
        cursor: not-allowed;
      }
      a:link, a:visited {
        color: var(--accent-color-blue);
      }
    </style>
  </head>
  <body>
    <div id="content">

      <div id="header-wrapper">
        <div id="header">
          <img src="favicon_32x32.png" alt="Allusion" />
          <h2>Allusion</h2>
        </div>
      </div>

      <div id="preview-img-wrapper">
          <img src="" id="preview-img" />
      </div>

      <p id="form-info"></p>
 
      <label for="tags-input">
        Add tags (comma separated):
      </label>
      <form id="tag-form" name="tagForm">
        <!-- TODO: multiple attribute doesn't work, only for type=email??? -->
        <input placeholder="Type tags here" id="tags-input" list="tags-datalist" name="tags" autofocus type="text" />

        <datalist id="tags-datalist">
          <!-- Filled with options in popup.js -->
        </datalist>

        <button type="submit" value="Submit" id="tag-form-submit" title="Save tags in Allusion">
          <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16"><path d="M9.8 20.2a1.3 1.3 0 0 1-1.2-.5l-6.7-7.8A1.6 1.6 0 0 1 2 9.7a1.5 1.5 0 0 1 2.1.2l6.8 7.9a1.5 1.5 0 0 1-.2 2.1 1.6 1.6 0 0 1-.9.3zm-.1 0a1.6 1.6 0 0 1-.9-.3 1.6 1.6 0 0 1-.2-2.1L19.8 4.3a1.7 1.7 0 0 1 2.2-.2 1.6 1.6 0 0 1 .2 2.1L10.9 19.7a1.3 1.3 0 0 1-1.2.5z" /></svg>
        </button>
      </form>
      <span id="submission-status"></span>
    </div>

    <script type="text/javascript" src="popup.js"></script>
  </body>
</html>
